‭<template>
  <div class="container">
    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect" :router="true" @click="saveNavState('/')">
      <el-menu-item index="baobiao" style="width: 230px;height: 60px"><i class="el-icon-data-line"></i>报表</el-menu-item>
      <el-menu-item index="neishen" style="width: 230px;height: 60px"><i class="el-icon-chat-line-round"></i>内审</el-menu-item>
      <el-menu-item index="waishen" style="width: 230px;height: 60px"><i class="el-icon-phone-outline"></i>外审</el-menu-item>
      <el-menu-item index="caiwu" style="width: 230px;height: 60px"><i class="el-icon-data-line"></i>财务</el-menu-item>
      <el-menu-item index="fangkuan" style="width: 230px;height: 60px"><i class="el-icon-sold-out"></i>放款</el-menu-item>
      <el-menu-item index="wode1" style="width: 230px;height: 60px"><i class="el-icon-user"></i>我的</el-menu-item>
      <el-menu-item index="tuichu" style="width: 230px;height: 60px" @click="dialogVisible = true"><i class="el-icon-switch-button"></i>退出
      </el-menu-item>

    </el-menu>
    <router-view></router-view>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        activeIndex:'baobiao',
        dialogVisible: false
      };
    },
    created(){
      this.getURL()
    },
    methods:{
      handleSelect(key, keyPath) {
        if(key=='tuichu') {
          window.sessionStorage.clear();
          this.$router.push('/login')
        }
      },
      getURL(){
        let self = this;
        let currentUrl = window.location.href;
        self.activeIndex = currentUrl.split('#')[1];
      }
    }
  }
</script>
<style>
  .container::before{
    font-size: 24px;
    font-weight: bold;
    content:"";
    opacity:0.7;
    background-image: url(../assets/img/home_bg.jpg);
    background-size: cover;
    z-index:-1;
    width:100%;
    height:100%;
    position:absolute;
    top:0px;
    left:0px;
    border-radius:40px;
  }
</style>

